Skip to content

update GPG key #1566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 9, 2024
Merged

update GPG key #1566

merged 3 commits into from
Jan 9, 2024

Conversation

vaol
Copy link
Contributor

@vaol vaol commented Jan 4, 2024

Summary

Provide a detailed description of all the changes present in this pull request.

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@CLAassistant
Copy link

CLAassistant commented Jan 4, 2024

CLA assistant check
All committers have signed the CLA.

donoghuc
donoghuc previously approved these changes Jan 4, 2024
@jonathannewman
Copy link

I'm seeing issues locally when trying to install:

[root@stunning-snort tmp]# puppet apply --execute "class { 'postgresql::globals': manage_package_repo => true, version=> '14' } class { 'postgresql::server':}"
Notice: Compiled catalog for stunning-snort.delivery.puppetlabs.net in environment production in 0.36 seconds
Notice: /Stage[main]/Postgresql::Repo::Yum_postgresql_org/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-14]/ensure: defined content as '{sha256}39b300676137bd3b801fa4cae9c7d2daf35d5cc61fcef26580eda69b1ac45d20'
Notice: /Stage[main]/Postgresql::Repo::Yum_postgresql_org/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common]/ensure: defined content as '{sha256}a18e7cea1aa78189e36f28ca9ebf293826a407a923a75ab4a6ecbc9ad5217f49'
Notice: /Stage[main]/Postgresql::Repo::Yum_postgresql_org/Yumrepo[yum.postgresql.org]/ensure: created
Notice: /Stage[main]/Postgresql::Repo::Yum_postgresql_org/Yumrepo[pgdg-common]/ensure: created
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install postgresql14-server' returned 1: warning: /var/cache/yum/x86_64/7/yum.postgresql.org/packages/postgresql14-libs-14.10-1PGDG.rhel7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 73e3b907: NOKEY
Public key for postgresql14-libs-14.10-1PGDG.rhel7.x86_64.rpm is not installed
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <[email protected]>"
 Fingerprint: d4bf 08ae 67a0 b4c7 a1db ccd2 40bc a2b4 08b4 0d20
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-14


Public key for postgresql14-server-14.10-1PGDG.rhel7.x86_64.rpm is not installed


 Failing package is: postgresql14-server-14.10-1PGDG.rhel7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-14
Error: /Stage[main]/Postgresql::Server::Install/Package[postgresql-server]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install postgresql14-server' returned 1: warning: /var/cache/yum/x86_64/7/yum.postgresql.org/packages/postgresql14-libs-14.10-1PGDG.rhel7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 73e3b907: NOKEY
Public key for postgresql14-libs-14.10-1PGDG.rhel7.x86_64.rpm is not installed
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <[email protected]>"
 Fingerprint: d4bf 08ae 67a0 b4c7 a1db ccd2 40bc a2b4 08b4 0d20
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-14


Public key for postgresql14-server-14.10-1PGDG.rhel7.x86_64.rpm is not installed


 Failing package is: postgresql14-server-14.10-1PGDG.rhel7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-14
Notice: /Stage[main]/Postgresql::Server::Initdb/Postgresql::Server::Instance::Initdb[main]/File[/var/lib/pgsql/14/data]: Dependency Package[postgresql-server] has failures: true
Warning: /Stage[main]/Postgresql::Server::Initdb/Postgresql::Server::Instance::Initdb[main]/File[/var/lib/pgsql/14/data]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Initdb/Postgresql::Server::Instance::Initdb[main]/Exec[postgresql_initdb_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/File[/var/lib/pgsql/14/data/postgresql.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_hba.conf]/Concat_file[/var/lib/pgsql/14/data/pg_hba.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_hba.conf]/File[/var/lib/pgsql/14/data/pg_hba.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_hba.conf]/Concat_fragment[/var/lib/pgsql/14/data/pg_hba.conf_header]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[port_for_instance_main]/Postgresql_conf[port_for_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[password_encryption_for_instance_main]/Postgresql_conf[password_encryption_for_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[data_directory_for_instance_main]/Postgresql_conf[data_directory_for_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_ident.conf]/Concat_file[/var/lib/pgsql/14/data/pg_ident.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_ident.conf]/File[/var/lib/pgsql/14/data/pg_ident.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_ident.conf]/Concat_fragment[/var/lib/pgsql/14/data/pg_ident.conf_header]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[local access as postgres user for instance main]/Concat::Fragment[pg_hba_rule_local access as postgres user for instance main]/Concat_fragment[pg_hba_rule_local access as postgres user for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[local access to database with same name for instance main]/Concat::Fragment[pg_hba_rule_local access to database with same name for instance main]/Concat_fragment[pg_hba_rule_local access to database with same name for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[allow localhost TCP access to postgresql user for instance main]/Concat::Fragment[pg_hba_rule_allow localhost TCP access to postgresql user for instance main]/Concat_fragment[pg_hba_rule_allow localhost TCP access to postgresql user for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[deny access to postgresql user for instance main]/Concat::Fragment[pg_hba_rule_deny access to postgresql user for instance main]/Concat_fragment[pg_hba_rule_deny access to postgresql user for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[allow access to all users for instance main]/Concat::Fragment[pg_hba_rule_allow access to all users for instance main]/Concat_fragment[pg_hba_rule_allow access to all users for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[allow access to ipv6 localhost for instance main]/Concat::Fragment[pg_hba_rule_allow access to ipv6 localhost for instance main]/Concat_fragment[pg_hba_rule_allow access to ipv6 localhost for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Instance::Systemd[main]/Systemd::Dropin_file[postgresql-14.conf]/File[/etc/systemd/system/postgresql-14.service.d]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Instance::Systemd[main]/Systemd::Dropin_file[postgresql-14.conf]/File[/etc/systemd/system/postgresql-14.service.d/postgresql-14.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Instance::Systemd[main]/Systemd::Dropin_file[postgresql-14.conf]/Systemd::Daemon_reload[postgresql-14.service]/Exec[systemd-postgresql-14.service-systemctl-daemon-reload]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Anchor[postgresql::server::service::begin::main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Service[postgresqld_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Postgresql_conn_validator[validate_service_is_running_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Anchor[postgresql::server::service::end::main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Reload/Postgresql::Server::Instance::Reload[main]/Exec[postgresql_reload_main]: Skipping because of failed dependencies
Notice: Applied catalog in 6.57 seconds
[root@stunning-snort tmp]# cat  /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-14
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQGNBGWBr8EBDAC+atC3Hl2yKkFg0F4tDg4ABCTvvhgMn7g7oZ0vJqpaUAwUgijU
+jL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x8baM4mdKVBmU9KQxRgno6lcks14STnawqf6o9nHxKp80VQrcNTsYHlq2B
PGAanK8G4WeYojQWCQHBi73qCoTERMpBG73gpTIr836TBinGZaSZ8I1deUS89Hnw
A62QO1TS57zxMTrstzaawLoCIHTqyJ2VeZrVC1INV4ENnyVsud3NaZtfWuIk7Q==
=Elfg
-----END PGP PUBLIC KEY BLOCK-----

I think that command should work?

@jonathannewman
Copy link

FWIW, issuing rpm -Uvh https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm seems to fix things, which implies to me the keys aren't correct or incomplete?

@vaol
Copy link
Contributor Author

vaol commented Jan 4, 2024 via email

@jonathannewman
Copy link

jonathannewman commented Jan 4, 2024

Yes, well centos7
Running that command seems to install PGDG-RPM-GPG-KEY-RHEL7 in /etc/pki/rpm-gpg which has this content:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)

mQGNBGWBsHEBDACzg9nBu9GXrquREAEVTObf6k3YIWagkv1qlX61dqQpyx8XT36A
+wx9qc7vk1mJoyzjq0gBH/C0ebaJntoCG/rv3j8DP4tQO+CApWN5XqrZJI+vYjRt
bJhrkxUt4fm8dozRykR9GdB05x35XVkzLsPVMqP6EqmBu9i2WgE30LlkPShzHyuf
P4W42zY4JVpKRK4CqLnWX3+PXY2tENYqkARK37j8r4klxIVku9UpE3W7XXIud9Nh
dVOtj0P8/t3mAHLgRjLqaGLVGz4k2b3phzDcG7sDvfwVXMPKDAVY5IymK4yTjeZU
6x3E63pNpQV4KfccHAKFJ++wOQmhfF5H+ViWTytIgyRMKn9eR+715nEZG8suRPSG
GnulJj9sUw6dONmPxCd6gCFQ0BAm/h7Bn8cODdPzJn6h/yMNs7SeH9yv8zlZvJdf
Sb5rTQLaFBaNP5yQ3rHb+gpDno7dwLxcx10qghPSz6TY96nCJNtrlj04P699UR4a
KIK2X6miJMwENE0AEQEAAbQ+UG9zdGdyZVNRTCBSUE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br3HmorjV
nvJYujuwQMN6JUavKKLC3zJSDOnBlZBGfoR00QWG5mHSgRxXLNVtaAWAqxrNcofc
wOu0Rr9O89AAePHzvZKXCu6aeWeBfhgKAz+wIjh9VjNFjAFLLVP3nWOIPbjN+Blv
Wy/OXDWFXwARAQABiQGfBBgBAgAJBQJlgbBxAhsMAAoJEGT6zhFz47kHJHcL/A0m
Jme0ERyl2d9z9wfmH4/mJ3lEsSmYRk1y8cQLJ3yXSdD0iYFRDaiLdhuV6CZQQHee
ong6TpGTe1REmmKBSOD6zdCfCcAMsk+SKQHADJD9es0ZleQOpdcVRgnLKGcze2qx
JzS4+0OoNkPg0Wf5pdDlKi0nJIr/t1qLU7TVOWTcUaYhjnrHy8iCWVNvrmm9tPLJ
4dS3OCxdzuTApUQAC26Lo6T0SOIc7COyshuhZe90IK/cRMuDuvf+8TqWBOE2sMJ0
2WNS8In5xWItAfoepmFLSOeWbCHo/yzuVFFI7Oo4DJ5cvKJ+Vo3iAWl8RPsN6iKE
Ocmphnc2clno8y4lSc4NckEbL+teZZyww12kHph5NUDReITO4H/4XGEpq4PATT6P
9aMDQQVK4GpmIZ6pLn+yYOV/ZLkHIcJUBVPjLtds5FOsVEpX4JaMowzk4jT6lp/F
7inS2V/87DcrYMl+NcBm09BZ6M4X1OYEumq7qXKtScmHAfp2yG2A1lJ5RtXrSQ==
=fPP0
-----END PGP PUBLIC KEY BLOCK-----

which seems to have nearly the identical content to the common key in this PR.

Additionally the yum.repos.d has this which implies the common key:

[pgdg-common]
name=PostgreSQL common RPMs $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common
repo_gpgcheck=1

@vaol
Copy link
Contributor Author

vaol commented Jan 4, 2024 via email

@jonathannewman
Copy link

Additionally tested on AlmaLinux 8 and redhat 8 and they have issues finding the packages:

[root@swell-ambiguity ~]# puppet apply --execute "class { 'postgresql::globals': manage_package_repo => true, version=> '14' } class { 'postgresql::server':}"
Notice: Compiled catalog for swell-ambiguity.delivery.puppetlabs.net in environment production in 0.35 seconds
Notice: /Stage[main]/Postgresql::Repo::Yum_postgresql_org/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-14]/ensure: defined content as '{sha256}39b300676137bd3b801fa4cae9c7d2daf35d5cc61fcef26580eda69b1ac45d20'
Notice: /Stage[main]/Postgresql::Repo::Yum_postgresql_org/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-common]/ensure: defined content as '{sha256}a18e7cea1aa78189e36f28ca9ebf293826a407a923a75ab4a6ecbc9ad5217f49'
Notice: /Stage[main]/Postgresql::Repo::Yum_postgresql_org/Yumrepo[yum.postgresql.org]/ensure: created
Notice: /Stage[main]/Postgresql::Repo::Yum_postgresql_org/Yumrepo[pgdg-common]/ensure: created
Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install postgresql14-server' returned 1: Error: Unable to find a match
Error: /Stage[main]/Postgresql::Server::Install/Package[postgresql-server]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install postgresql14-server' returned 1: Error: Unable to find a match
Notice: /Stage[main]/Postgresql::Server::Initdb/Postgresql::Server::Instance::Initdb[main]/File[/var/lib/pgsql/14/data]: Dependency Package[postgresql-server] has failures: true
Warning: /Stage[main]/Postgresql::Server::Initdb/Postgresql::Server::Instance::Initdb[main]/File[/var/lib/pgsql/14/data]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Initdb/Postgresql::Server::Instance::Initdb[main]/Exec[postgresql_initdb_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/File[/var/lib/pgsql/14/data/postgresql.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_hba.conf]/Concat_file[/var/lib/pgsql/14/data/pg_hba.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_hba.conf]/File[/var/lib/pgsql/14/data/pg_hba.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_hba.conf]/Concat_fragment[/var/lib/pgsql/14/data/pg_hba.conf_header]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[port_for_instance_main]/Postgresql_conf[port_for_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[password_encryption_for_instance_main]/Postgresql_conf[password_encryption_for_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Config_entry[data_directory_for_instance_main]/Postgresql_conf[data_directory_for_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_ident.conf]/Concat_file[/var/lib/pgsql/14/data/pg_ident.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_ident.conf]/File[/var/lib/pgsql/14/data/pg_ident.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Concat[/var/lib/pgsql/14/data/pg_ident.conf]/Concat_fragment[/var/lib/pgsql/14/data/pg_ident.conf_header]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[local access as postgres user for instance main]/Concat::Fragment[pg_hba_rule_local access as postgres user for instance main]/Concat_fragment[pg_hba_rule_local access as postgres user for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[local access to database with same name for instance main]/Concat::Fragment[pg_hba_rule_local access to database with same name for instance main]/Concat_fragment[pg_hba_rule_local access to database with same name for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[allow localhost TCP access to postgresql user for instance main]/Concat::Fragment[pg_hba_rule_allow localhost TCP access to postgresql user for instance main]/Concat_fragment[pg_hba_rule_allow localhost TCP access to postgresql user for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[deny access to postgresql user for instance main]/Concat::Fragment[pg_hba_rule_deny access to postgresql user for instance main]/Concat_fragment[pg_hba_rule_deny access to postgresql user for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[allow access to all users for instance main]/Concat::Fragment[pg_hba_rule_allow access to all users for instance main]/Concat_fragment[pg_hba_rule_allow access to all users for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Pg_hba_rule[allow access to ipv6 localhost for instance main]/Concat::Fragment[pg_hba_rule_allow access to ipv6 localhost for instance main]/Concat_fragment[pg_hba_rule_allow access to ipv6 localhost for instance main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Instance::Systemd[main]/Systemd::Dropin_file[postgresql-14.conf]/File[/etc/systemd/system/postgresql-14.service.d]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Instance::Systemd[main]/Systemd::Dropin_file[postgresql-14.conf]/File[/etc/systemd/system/postgresql-14.service.d/postgresql-14.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Config/Postgresql::Server::Instance::Config[main]/Postgresql::Server::Instance::Systemd[main]/Systemd::Dropin_file[postgresql-14.conf]/Systemd::Daemon_reload[postgresql-14.service]/Exec[systemd-postgresql-14.service-systemctl-daemon-reload]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Anchor[postgresql::server::service::begin::main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Service[postgresqld_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Postgresql_conn_validator[validate_service_is_running_instance_main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Service/Postgresql::Server::Instance::Service[main]/Anchor[postgresql::server::service::end::main]: Skipping because of failed dependencies
Warning: /Stage[main]/Postgresql::Server::Reload/Postgresql::Server::Instance::Reload[main]/Exec[postgresql_reload_main]: Skipping because of failed dependencies
Notice: Applied catalog in 9.67 seconds

@jonathannewman
Copy link

jonathannewman commented Jan 4, 2024

Issuing dnf -qy module disable postgresql on the redhat 8 system prior to installing the module seems to fix the issue with it not being found. Also an issue on AlmaLinux 8.

@ekohl ekohl linked an issue Jan 5, 2024 that may be closed by this pull request
@ekohl
Copy link
Collaborator

ekohl commented Jan 5, 2024

Issuing dnf -qy module disable postgresql on the redhat 8 system prior to installing the module seems to fix the issue with it not being found. Also an issue on AlmaLinux 8.

There is code to manage the DNF module:

if $manage_dnf_module {
class { 'postgresql::dnfmodule':
ensure => $globals_version,
}
}

However, I didn't consider ensuring the DNF module is absent so you can use the package repo. Perhaps the logic needs to be enhanced that if you enable $manage_package_repo then it should also ensure the DNF module is absent (on EL 8 & 9).

@vaol
Copy link
Contributor Author

vaol commented Jan 5, 2024

After checking on CentOS7, Almalinux8 and Almalinux9 it indeed seems that the GPG key is different on RH7 than the others.

I have pushed a new change, with his version I am able to properly install PostgreSQL on both CentOS7 and Almalinux9.

@jonathannewman
Copy link

Confirmed working on centos7. Works on almalinux8 and redhat 8 with the dnf -qy module disable postgresql, otherwise fails with:

Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install postgresql14-server' returned 1: Error: Unable to find a match: postgresql14-server
Error: /Stage[main]/Postgresql::Server::Install/Package[postgresql-server]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install postgresql14-server' returned 1: Error: Unable to find a match: postgresql14-server

Seems like that should be a separate issue?

@vchepkov
Copy link

vchepkov commented Jan 7, 2024

imho, module should provide a parameter to override location of the key, this way module users can easily address it via hiera in the future

@Ramesh7
Copy link
Contributor

Ramesh7 commented Jan 8, 2024

Thanks @vaol for raising the PR and @jonathannewman & @donoghuc for validating and review.

I was looking at pipeline failures for CentOS, AlmaLinux and Rocky, the rerun doesn't work as expected so tried locally (CentOS & AlmaLinux) and works fine but here on github actions there are not showing much details.

Checking further.

@Ramesh7
Copy link
Contributor

Ramesh7 commented Jan 8, 2024

Looks like while running test for multi instance postgresql (https://github.com/puppetlabs/puppetlabs-postgresql/blob/main/spec/acceptance/server_instance_spec.rb#L18-L21), the spec trying to stop main postgres service and thats where it hags and keep waiting for service to stop.
Strace :

select(13, [3 12], [], [], {tv_sec=0, tv_usec=100000}) = 0 (Timeout)
wait4(13722, 0x7ffe770650c8, WNOHANG, NULL) = 0

Process 13722 :

root       13722   13564  0 08:09 ?        00:00:00 /bin/systemctl stop -- postgresql

@Ramesh7
Copy link
Contributor

Ramesh7 commented Jan 8, 2024

@vaol can you please rebase the PR?
Once done we should be good to take it forward.

@vaol
Copy link
Contributor Author

vaol commented Jan 8, 2024

Hello, sure, I just did. Let me know if anything else.

@Ramesh7 Ramesh7 merged commit 07ae23f into puppetlabs:main Jan 9, 2024
@donoghuc
Copy link

donoghuc commented Jan 9, 2024

@Ramesh7 is there a new GH issue or puppet ticket tracking this work? #1566 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPG Key Outdated on Tag 8.2.1 GPG Key no longer valid for RPMS
9 participants